home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / TOUR.DIR / 00003_Script_3 < prev    next >
Text File  |  1995-11-15  |  11KB  |  437 lines

  1. on showHilite
  2.   global gCurrChan,gFirsChan,gLastChan,gTourButtons,gPrevHilite
  3.   put getAprop(gTourButtons,gCurrChan) into thisOne
  4.   goMovieGo
  5.   
  6.   set m = the movie
  7.   testOverheadMenu
  8.   if m <> the movie then exit
  9.   
  10.   updateController
  11.   
  12.   if (the visibility of sprite gCurrChan) and rollOver(gCurrChan) then
  13.     put the puppet of sprite gCurrChan into pState
  14.     puppetSprite gCurrChan,false
  15.     put the castnum of sprite gCurrChan into it
  16.     set the puppet of sprite gCurrChan to pState
  17.     goMovieGo
  18.     if (it<>0) then
  19.       if gCurrChan <> gPrevHilite then
  20.         goMovieGo
  21.         rollo(thisOne)
  22.         put gCurrChan into gPrevHilite
  23.       end if
  24.       if the mouseDown then
  25.         goMovieGo
  26.         
  27.         --        set n = the castNum of sprite gCurrChan
  28.         --        if n <> -1 then
  29.         --          set n = the name of cast n
  30.         --          if n = "TCR.PIC" or n = "TTR.PIC" then exit
  31.         --        end if        
  32.         
  33.         press(thisOne)
  34.         put 0 into gPrevHilite
  35.         if rollover(gCurrChan) then
  36.           goMovieGo
  37.           set m = the movie
  38.           doScript(thisOne)
  39.           if the movie <> m then exit
  40.           goMovieGo
  41.           norm(thisOne)
  42.           if gCurrChan < 5 then
  43.             repeat while the mouseDown
  44.               goMovieGo
  45.             end repeat
  46.           end if
  47.           
  48.         end if
  49.       end if
  50.     else
  51.       if gCurrChan = 4 and rollOver(2) then set gCurrChan = 2
  52.       if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  53.         --put "backward"
  54.         set gCurrChan = gCurrChan - 1
  55.       else
  56.         put gCurrChan+1 into gCurrChan
  57.         if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  58.       end if
  59.       
  60.     end if
  61.   else
  62.     goMovieGo
  63.     if gCurrChan = gPrevHilite then norm(thisOne)
  64.     put 0 into gPrevHilite
  65.     if gCurrChan = 4 and rollOver(2) then 
  66.       set gCurrChan = 2
  67.       --put ">>>set special"
  68.       put gCurrChan && gFirsChan
  69.     end if
  70.     
  71.     if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  72.       --put "2backward"
  73.       set gCurrChan = gCurrChan - 1
  74.       
  75.     else
  76.       put gCurrChan+1 into gCurrChan
  77.       if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  78.     end if
  79.     
  80.   end if
  81.   goMovieGo
  82. end showHilite
  83.  
  84. on large
  85.   global gTourLabel, gCurLabelProp
  86.   
  87.   set gTourLabel = (char 1 to 2 of gTourLabel)&"L" 
  88.   set gCurLabelProp = gTourLabel
  89.   size "large"
  90. end
  91.  
  92. on small
  93.   global gTourLabel, gCurLabelProp
  94.   set gTourLabel = (char 1 to 2 of gTourLabel)&"S" 
  95.   set gCurLabelProp = gTourLabel
  96.   size "small"
  97. end
  98.  
  99. --dmdabc
  100.  
  101. on size whichWay
  102.   if the framelabel <> "" then 
  103.     if whichWay = "large" then go next 
  104.     else go previous
  105.   else
  106.     if whichWay ="small" then
  107.       goSmaller
  108.     else goBigger
  109.   end if
  110. end size
  111.  
  112.  
  113.  
  114. on controller
  115.   global gTourIsPlaying
  116.   
  117.   if not gTourIsPlaying then playTour
  118.   
  119.   if the visible of sprite 14 then
  120.     puppetSprite 15,0
  121.     set the visible of sprite 14 = 0
  122.     set the visible of sprite 15 = 0
  123.   else  
  124.     puppetSprite 15,1
  125.     set the visible of sprite 14 = 1
  126.     set the visible of sprite 15 = 1
  127.   end if
  128. end controller
  129.  
  130. on updateController
  131.   
  132.   if the type of sprite 12 <> 16 then exit
  133.   
  134.   set s = the stopTime of sprite 12
  135.   set w = the width of sprite 12
  136.   set p = the movieTime of sprite 12
  137.   set r = the right of sprite 12
  138.   
  139.   set h = r-(w-(p*w)/s)
  140.   
  141.   set the locH of sprite 15 = h
  142. end updateController
  143.  
  144. on setController onOff
  145.   if onOff then
  146.     if the visible of sprite 14 then
  147.       puppetSprite 15,1  
  148.       updateController
  149.       set the visibility of sprite 15 = 1  
  150.     end if
  151.   else
  152.     puppetSprite 15, 0
  153.     set the visibility of sprite 14 = 0
  154.     set the visibility of sprite 15 = 0
  155.   end if
  156.   
  157. end setController
  158.  
  159. on goSmaller
  160.   global gTourLabel
  161.   set gTourLabel = (char 1 to 2 of gTourLabel)&"S" 
  162.   put (label(gTourLabel)) into frameNumber
  163.   puppetSprite 15, 0
  164.   set the visibility of sprite 15 = 0
  165.   go frame frameNumber+1
  166.   setController 1
  167.   updateStage
  168. end
  169.  
  170. on goBigger
  171.   global gTourLabel
  172.   set gTourLabel = (char 1 to 2 of gTourLabel)&"L" 
  173.   put (label(gTourLabel)) into frameNumber
  174.   puppetSprite 15, 0
  175.   set the visibility of sprite 15 = 0
  176.   go frame frameNumber+1
  177.   setController 1
  178.   updateStage
  179. end
  180.  
  181. on testVisitLabels castName
  182.   global gLabels
  183.   
  184.   set hitList to value(field castName)
  185.   set c = count(hitList)
  186.   repeat with i = 1 to c
  187.     set theLabel = getAt(hitList, i) 
  188.     if theLabel = "" then next repeat
  189.     set list = getAProp(gLabels, theLabel)
  190.     put i && theLabel 
  191.     put getAt(list,1)
  192.   end repeat
  193.   
  194.   
  195.   put "done."
  196. end
  197.  
  198.  
  199.  
  200.  
  201. on lookUpTime curTime
  202.   global gTourLabel
  203.   
  204.   set tLab = char 1 to 2 of gTourLabel
  205.   if tLab = "EM" then return ""
  206.   
  207.   set hitList to value(string(field tLab))
  208.   set c = count(hitList)
  209.   repeat with i = 1 to c 
  210.     set t = getPropAt(hitList, i)  
  211.     if t > curTime then 
  212.       set theLabel = getAt(hitList, i)
  213.       exit repeat
  214.     end if
  215.   end repeat 
  216.   
  217.   return theLabel
  218. end lookUpTime
  219.  
  220. on visit
  221.   global gTourLabel, gTourTimeSS, gTourTimeMW, gTourTimeCL
  222.   
  223.   --if gTourLabel = "EMS" then exit -- no links
  224.   if the type of sprite 12 = 16 then
  225.     put  the movieTime of sprite 12 into curTime
  226.   end if
  227.   
  228.   do "set gTourTime"&char 1 to 2 of gTourLabel & " = curTime"
  229.   set theLabel = lookUpTime(curTime)
  230.   
  231.   if theLabel = "" then 
  232.     set the visibility of sprite 9 = 0
  233.     exit -- no tour here
  234.   end if
  235.   
  236.   puppetSprite 15,0
  237.   goGo(theLabel)
  238.   --go frame theLabel of movie getAt(xList,2)
  239. end
  240.  
  241. on continue
  242.   playTour
  243. end
  244.  
  245. on nextTour
  246.   global gTourLabel, gCurLabelProp
  247.   --puppetTransition 50,1,120,false
  248.   stopTour
  249.   put char 1 to 2 of gTourLabel into thisMovie
  250.   put char 3 of gTourLabel into thisSize
  251.   if thisMovie = "SS" then  put "CL" into newMovie
  252.   else  if thisMovie = "CL" then put "EM" into newMovie
  253.   else  if thisMovie = "EM" then put "MW" into newMovie
  254.   else  if thisMovie = "MW" then put "SS" into newMovie
  255.   set gTourLabel = newMovie&thisSize
  256.   addToRetrace
  257.   set the visible of sprite 9 = 0
  258.   set the visible of sprite 10 = 0
  259.   set gCurLabelProp = gTourLabel
  260.   go frame gTourLabel
  261.   patchPal
  262.   updateStage
  263. end nextTour
  264.  
  265. on prevTour
  266.   global gTourLabel, gCurLabelProp
  267.   --puppetTransition 50,1,120,false
  268.   stopTour
  269.   put char 1 to 2 of gTourLabel into thisMovie
  270.   put char 3 of gTourLabel into thisSize
  271.   if thisMovie = "CL" then  put "SS" into newMovie
  272.   else  if thisMovie = "SS" then put "MW" into newMovie
  273.   else  if thisMovie = "MW" then put "EM" into newMovie
  274.   else  if thisMovie = "EM" then put "CL" into newMovie
  275.   put newMovie&thisSize
  276.   set gTourLabel = newMovie&thisSize
  277.   addToRetrace
  278.   set the visible of sprite 9 = 0
  279.   set the visible of sprite 10 = 0
  280.   set gCurLabelProp = gTourLabel
  281.   go frame gTourLabel
  282.   patchPal
  283.   updateStage
  284. end prevTour
  285.  
  286. on playTour
  287.   global gTourLabel,gTourIsPlaying, gVolume
  288.   global gTourTimeSS, gTourTimeMW, gTourTimeCL
  289.   
  290.   global gHelpOffScreen, gHelpPalette
  291.   
  292.   if not voidP(gHelpOffScreen) and not gHelpOffScreen then 
  293.     returnFromHelp
  294.     repeat while the mouseDown
  295.     end repeat
  296.     
  297.     exit
  298.   end if
  299.   
  300.   cursor 4
  301.   
  302.   put "T"&(char 1 to 2 of gTourLabel)&".MOV" into preloadName
  303.   set cn = the number of cast preloadName
  304.   
  305.   --
  306.   --
  307.   -- TBD DMD get time to return to if returning from an object OR
  308.   -- linking from an object in COs...
  309.   --
  310.   set tourTime = 0
  311.   do "set tourTime = gTourTime"&char 1 to 2 of gTourLabel
  312.   
  313.   set oldLabel = the frame
  314.   set newLabel = label(gTourLabel)+1
  315.   
  316.   if oldLabel <> newLabel then
  317.     set the controller of cast cn = false
  318.     set the visible of sprite 14 = 0
  319.     set the visible of sprite 15 = 0
  320.   end if
  321.   
  322.   go frame newLabel
  323.   
  324.   
  325.   if gTourIsPlaying then 
  326.     pauseTour
  327.   else
  328.     set the visible of sprite 9 to false
  329.     set the visible of sprite 10 to false
  330.     set the visible of sprite 13 = false
  331.     --puppetSprite 12, true
  332.     
  333.     if not voidP(tourTime) then
  334.       set the movieTime of sprite 12 = tourTime
  335.       do "set gTourTime"&char 1 to 2 of gTourLabel & " = void"
  336.     end if
  337.     
  338.     set the volume of sprite 12 to gVolume
  339.     set the stopTime of sprite 12 to (the duration of cast preloadName)
  340.     updateStage
  341.     set the movieRate of sprite 12 to 1
  342.     put true into gTourIsPlaying
  343.     updateStage
  344.   end if
  345.   
  346.   cursor -1
  347.   
  348. end playTour
  349.  
  350. on pauseTour noButtons
  351.   global gTourLabel, gTourIsPlaying
  352.   global gTourTimeSS, gTourTimeMW, gTourTimeCL, gTourTimeEM, gTourLabel
  353.   
  354.   if the type of sprite 12 = 16 then
  355.     if the movieTime of sprite 12 >= the stopTime of sprite 12 then set noButtons = 1
  356.   end if
  357.   
  358.   
  359.   if gTourIsPlaying then
  360.     --puppetSprite 12,true 
  361.     
  362.     --dmdabc
  363.     if the type of sprite 12 = 16 then
  364.       repeat while the volume of sprite 12 > 0
  365.         set the volume of sprite 12 to (the volume of sprite 12)/2
  366.         updateStage
  367.         delay 8
  368.       end repeat
  369.       set the movieRate of sprite 12 to 0
  370.       set curTime = the movieTime of sprite 12
  371.       do "set gTourTime" & char 1 to 2 of gTourLabel & "= curTime"
  372.       set s = lookUpTime(curTime)
  373.       set the visible of sprite 9 = s<>"" and not noButtons
  374.       set the visible of sprite 10 to not noButtons
  375.     end if
  376.     
  377.     put false into gTourIsPlaying
  378.   end if
  379. end pauseTour
  380.  
  381. on stopTour
  382.   global gTourLabel, gTourIsPlaying
  383.   global gTourTimeSS, gTourTimeMW, gTourTimeCL, gTourTimeEM
  384.   
  385.   
  386.   if the type of sprite 12 = 16 then
  387.     do "set gTourTime" & char 1 to 2 of gtourlabel & "= the movietime of sprite 12"
  388.   end if
  389.   
  390.   --  if gTourIsPlaying then
  391.   if marker(0) <> the frame then
  392.     setController 0
  393.     set the visible of sprite 9 to false
  394.     set the visible of sprite 10 to false
  395.     
  396.     repeat with i = 1 to 8
  397.       set the volume of sprite 12 to (the volume of sprite 12)-32
  398.       delay 8
  399.     end repeat
  400.     --set the directToStage of cast(the castNum of sprite 12) to false
  401.     set the controller of cast (the castNum of sprite 12) to false
  402.     set the movieRate of sprite 12 to 0
  403.     set the movieTime of sprite 12 to 0
  404.     puppetSprite 12, false
  405.     put "T"&(char 1 to 2 of gTourLabel)&".MOV" into preloadName
  406.     repeat while true
  407.       unloadcast preloadName
  408.       if not(the loaded of cast preloadName) then exit repeat
  409.     end repeat
  410.     put false into gTourIsPlaying
  411.     go to (the frame)-1
  412.   end if
  413. end stopTour
  414.  
  415. on goMovieGo
  416.   global gTourIsPlaying
  417.   
  418.   if the castNum of sprite 12 > 0 then
  419.     if the castType of cast the castnum of sprite 12 <> #digitalVideo then exit
  420.     if the movieRate of sprite 12 = 0 then 
  421.       
  422.       if gTourIsPlaying then 
  423.         if the movietime of sprite 12 >= the stoptime of sprite 12 then
  424.           setcontroller 0
  425.           go to the frame - 1  
  426.         end if
  427.         
  428.         pauseTour
  429.       end if
  430.       
  431.     else if not gTourIsPlaying then 
  432.       playTour
  433.     end if
  434.     
  435.   end if
  436.   
  437. end goMovieGo